import { BasicColumn, FormSchema } from '/@/components/Table';

import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n('monitor.datalog.fields');
export const datalogFields = {
  dataTable: t('dataTable'),
  dataId: t('dataId'),
  dataVersion: t('dataVersion'),
  dataContent: t('dataContent'),
  createBy: t('createBy'),
};

export const columns: BasicColumn[] = [
  {
    title: datalogFields.dataTable,
    dataIndex: 'dataTable',
    width: 150,
    align: 'left',
  },
  {
    title: datalogFields.dataId,
    dataIndex: 'dataId',
    width: 350,
  },
  {
    title: datalogFields.dataVersion,
    dataIndex: 'dataVersion',
    width: 120,
  },
  {
    title: datalogFields.dataContent,
    dataIndex: 'dataContent',
  },
  {
    title: datalogFields.createBy,
    dataIndex: 'createBy',
    sorter: true,
    width: 200,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'dataTable',
    label: datalogFields.dataTable,
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'dataId',
    label: datalogFields.dataId,
    component: 'Input',
    colProps: { span: 8 },
  },
];
